import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);

const routes = [
  // 过渡页
  { path: "/" },
  // 登录页面
  { path: "/login", name: "login", component: () => import("../views/login") },
  // 404页面
  {
    path: "/error404",
    name: "error404",
    component: () => import("../views/error404"),
  },
  // 首页
  {
    path: "/index",
    name: "index",
    component: () => import("../views/index"),
    children: [
      // 系统-用户管理
      {
        path: "admin",
        name: "XT_YHGL",
        component: () => import("../views/system/admin/admin"),
      },
      // 系统-角色管理
      {
        path: "role",
        name: "XT_JSGL",
        component: () => import("../views/system/role/role"),
      },
      // 系统-配置管理
      {
        path: "config",
        name: "XT_PZGL",
        component: () => import("../views/system/config/config"),
      },
      // 系统-APP版本管理
      {
        path: "app-edition",
        name: "XT_APPBBGL",
        component: () => import("../views/system/edition/edition"),
      },
      // 系统-菜单管理
      {
        path: "permission",
        name: "XT_CDGL",
        component: () => import("../views/system/permission/permission"),
      },
      // 商城-商品管理
      {
        path: "mall-goods",
        name: "SC_SPGL",
        component: () => import("../views/mall/goods/goods"),
      },
      // 商城-快手团购配置
      {
        path: "kuaishou-ticket-management",
        name: "SC_KSTGPZ",
        component: () =>
          import(
            "../views/mall/kuaishou-ticket-management/kuaishou-ticket-management"
          ),
      },
      // 商城-团购订单
      {
        path: "group-purchase-order",
        name: "SC_TGDD",
        component: () =>
          import("../views/mall/group-purchase-order/group-purchase-order"),
      },
      // 商城-banner管理
      {
        path: "banner",
        name: "SC_BNGL",
        component: () => import("../views/mall/banner/banner"),
      },
      // 商城-分类管理
      {
        path: "mall-type",
        name: "SC_FLGL",
        component: () => import("../views/mall/type/type"),
      },
      // 商城-运费模板
      {
        path: "freight",
        name: "SC_YFMB",
        component: () => import("../views/mall/freight/freight"),
      },
      // 商城-运费模板
      {
        path: "mall-order",
        name: "SC_DDGL",
        component: () => import("../views/mall/order/order"),
      },
      // 商城-运费模板
      {
        path: "mall",
        name: "SC_SHGL",
        component: () => import("../views/mall/mall/mall"),
      },
      // 用户-用户管理
      {
        path: "user",
        name: "YH_YHGL",
        component: () => import("../views/user/user/user"),
      },
      // 用户-消息管理
      {
        path: "message",
        name: "YH_XXGL",
        component: () => import("../views/user/message/message"),
      },
      // 会员-商品管理
      {
        path: "vip-goods",
        name: "HY_SPGL",
        component: () => import("../views/vip/goods/goods"),
      },
      // 会员-订单管理
      {
        path: "vip-order",
        name: "HY_DDGL",
        component: () => import("../views/vip/order/order"),
      },
      // 会员-充值管理
      {
        path: "recharge",
        name: "HY_CZGL",
        component: () => import("../views/vip/recharge/recharge"),
      },
      // 会员-提现管理
      {
        path: "withdrawal",
        name: "HY_TXGL",
        component: () => import("../views/vip/withdrawal/withdrawal"),
      },
      // 营销-签到管理
      {
        path: "sign",
        name: "YX_QDGL",
        component: () => import("../views/marketing/sign/sign"),
      },
      // 营销-活动弹框
      {
        path: "popup",
        name: "YX_HDTK",
        component: () => import("../views/marketing/popup/popup"),
      },
    ],
  },
];

const router = new VueRouter({
    // mode: 'history',
    // base: process.env.BASE_URL,
    routes
});

export default router
